package com.example.demo.zabbix.request.builder.discovery;

import com.example.demo.zabbix.request.BaseRequest;
import com.example.demo.zabbix.request.builder.request.CreateRequestBuilder;

import java.util.List;
import java.util.Map;

/**
 * https://www.zabbix.com/documentation/4.0/manual/api/reference/drule/create
 */
public class DiscoveryRuleCreateRequestBuilder extends CreateRequestBuilder {
    private String name;
    private String iprange;
    private List<Map<String,Object>> dchecks;
    public DiscoveryRuleCreateRequestBuilder(String auth) {
        super("drule.create", auth);
    }

    public DiscoveryRuleCreateRequestBuilder(Long id, String auth) {
        super("drule.create", id, auth);
    }

    public List<Map<String, Object>> getDchecks() {
        return dchecks;
    }

    public DiscoveryRuleCreateRequestBuilder setDchecks(List<Map<String, Object>> dchecks) {
        this.dchecks = dchecks;
        return this;
    }

    public String getName() {
        return name;
    }

    public DiscoveryRuleCreateRequestBuilder setName(String name) {
        this.name = name;
        return this;
    }

    public String getIprange() {
        return iprange;
    }

    public DiscoveryRuleCreateRequestBuilder setIprange(String iprange) {
        this.iprange = iprange;
        return this;
    }

    @Override
    public BaseRequest<Map<String, Object>> builder() {
        baseRequest.getParams().put("name",name);
        baseRequest.getParams().put("iprange",iprange);
        baseRequest.getParams().put("dchecks",dchecks);
        return baseRequest;
    }
}
